<template>
  <div class="app-main-container tabpdding">
    <el-tabs v-model="activeTab">
      <el-tab-pane
        v-if="meta.indexOf('TicketStatistics') > -1"
        :label="translate('mpxstj')"
        name="0"
      >
	   <div class="warnningTip">
	   		  <i class="el-icon-warning-outline" />
	   		   {{$t("message.xstjfsssjtj")}} 
	   </div>
	  <Sales
        v-if="activeTab === '0'"
      /></el-tab-pane>
      <el-tab-pane
        v-if="meta.indexOf('ShopTicketOrderDetialList') > -1"
        :label="translate('mpxsmx')"
        name="1"
      ><TicketDetail
        v-if="activeTab === '1'"
      /></el-tab-pane>
    </el-tabs>
  </div>
</template>

<script>
import TicketDetail from './ticketDetail'
import Sales from './ticketSales'
export default {
  name: 'TicketSales',
  components: {
    TicketDetail,
    Sales
  },
  data() {
    return {
      activeTab: '',
      meta: []
    }
  },
  created() {
    let activeTab = ''
    const meta = this.$route.meta.buttons || []
    if (meta.indexOf('TicketStatistics') > -1) {
      activeTab = '0'
    } else if (meta.indexOf('ShopTicketOrderDetialList') > -1) {
      activeTab = '1'
    }
    this.activeTab = activeTab
    this.meta = meta
  }

}
</script>
